package com.blacktech.dbu.meta.entity;

import com.blacktech.dbu.core.common.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 数据字典信息
 *
 * @author yanyunsong
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "dbu_dictionary")
public class DbuDictionary extends BaseEntity {
    /**
     * 字典编号
     */
    @Column(name = "dict_code", unique = true)
    private String dictCode;

    /**
     * 字典名称
     */
    @Column(name = "dict_name")
    private String dictName;

    /**
     * 字典描述
     */
    @Column(name = "dict_desc")
    private String dictDesc;

    /**
     * 字典项列表
     */
    @OneToMany(mappedBy = "dictionary", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
    private List<DbuDictionaryItem> items;
}